<?php
  
  require_once "JooS/Server/Request/Abstract.php";

  class JooS_Server_Request_Http extends JooS_Server_Request_Abstract {
    public function __construct() {
      $this->setHost($_SERVER["HTTP_HOST"]);
      $this->setMethod($_SERVER["REQUEST_METHOD"]);
      $this->setRequestUri($_SERVER["REQUEST_URI"]);
      $this->setPost($_POST);
      $this->setCookie($_COOKIE);
    }

    public function getRawBody() {
      $body = file_get_contents('php://input');
      if (strlen(trim($body)) > 0) {
        return $body;
      }
      return false;
    }
    
    public function setRawBody($body) {
      self::throwException("Call of function setRawBody is not permitted in " . __CLASS__);
    }
  }

?>